import request from 'utils/request'
/**
 * 获取文章接口
 * @param {*} params
 * @returns
 */
export const getArticles = (params) => {
  return request({
    url: '/mp/articles',
    method: 'GET',
    params,
  })
}

/**
 * 删除文章接口
 * @param {*} id
 * @returns
 */
export const delArticles = (id) => {
  return request({
    url: `/mp/articles/${id}`,
    method: 'delete',
  })
}

/**
 * 添加文章接口
 * @param {*} data
 * @returns
 */
export const addArticles = (data, draft = false) => {
  // return request.post('/mp/articles' ,data )
  return request({
    url: `/mp/articles?draft=${draft}`,
    method: 'POST',
    data,
  })
}
